package cn.yangliu.nacos.comm.model;

import java.time.LocalDateTime;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import cn.yangliu.nacos.comm.constant.GlobalConstants;
import cn.yangliu.nacos.comm.constant.GlobalValidateConstants;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2019 -12-31
 */
@Data
public class Oauth2InsertModel {

    /**
     * current class instance's member.
     * The Username.
     */
    @NotBlank(message = GlobalValidateConstants.USERNAME_MISS)
    private String username;

    /**
     * current class instance's member.
     * The Password.
     */
    @NotBlank(message = GlobalValidateConstants.PASSWORD_MISS)
    private String password;

    /**
     * current class instance's member.
     * The Email.
     */
    @NotBlank(message = GlobalValidateConstants.EMAIL_MISS)
    @Email(message = GlobalValidateConstants.EMAIL_ILLEGAL)
    private String email;

    /**
     * current class instance's member.
     * The Mobile.
     */
    @NotBlank(message = GlobalValidateConstants.MOBILE_MISS)
    @Pattern(regexp = GlobalConstants.MOBILE_REGEXP, message = GlobalValidateConstants.MOBILE_ILLEGAL)
    private String mobile;

    /**
     * current class instance's member.
     * The Account expire time.
     */
    @JsonFormat(pattern = GlobalConstants.DATETIME)
    @DateTimeFormat(pattern = GlobalConstants.DATETIME)
    @NotNull(message = GlobalValidateConstants.ACCOUNT_EXPIRETIME_MISS)
    private LocalDateTime accountExpireTime;

    /**
     * current class instance's member.
     * The Remark.
     */
    private String remark;

}
